package com.study.controller;

import com.github.pagehelper.PageHelper;
import com.study.mapper.CountryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : wilbur.yuan
 * @date : 2019-02-25
 */
@RestController
@RequestMapping("/")
public class HelloController {

    @Autowired
    private CountryMapper mapper;

    @GetMapping
    public Object hello() {
        return PageHelper
                .startPage(2, 1)
                .doSelectPageInfo(() -> mapper.selectAll());
    }
}
